import { createApp } from 'vue'
import App from './App.vue'
import router from './routers'
import pinia from './store'

import { registerElIcons } from '@/plugins/ElIcons'
// 引入全局组件布局
import PageWrapLayout from '@/components/PageWrapLayout/index.vue'
// 权限路由
import './permission'
// svg-icons注册导入
import 'virtual:svg-icons-register'
import SvgIcon from '@/components/SvgIcon/index.vue' // svg component
// UI框架 element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 引入暗黑模式 element-plus 2.2 内置暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'
// 签字组件

// 自定义暗黑模式
import '@/styles/element-dark.scss'
// 引入阿里图标库
import '@/assets/iconfont/iconfont.css'
import '@/assets/iconfont/iconfont.js'

import { download} from "@/utils/download";// 下载文件


const app = createApp(App)
registerElIcons(app)


/*挂载全局方法*/
// const { proxy }: any = getCurrentInstance(); 进行调用
app.config.globalProperties.$handleTree = handleTree
app.config.globalProperties.$resetForm = resetForm /*重置表单*/
app.config.globalProperties.$tableRowClassName = tableRowClassName /*重置表单*/
app.config.globalProperties.$download = download /*下载文件*/
app.config.globalProperties.$getServerUrl = getServerUrl /*获取服务地址*/
app.config.globalProperties.$addDateRange = addDateRange /*时间日期收集*/



//粒子组件
//import Particles from 'particles.vue3'
//import VueParticles from 'vue-particles'

/*字典的安装*/
import DictData from '@/components/DictData'
DictData.install(app)
import plugins from './plugins' // plugins
/*指令*/
import Directive from '@/directive'
import { addDateRange, getServerUrl, handleTree, resetForm, tableRowClassName } from "@/utils/yixia";
app.use(Directive)
app.use(plugins)


app.component('svg-icon', SvgIcon)
app.component('PageWrapLayout', PageWrapLayout)
//安装粒子效果插件
//app.use(VueParticles)
app.use(pinia)
app.use(router)
app.use(ElementPlus).mount('#app')
